package com.lrs.java.j2se_self.thread;
import java.util.*;
public class TestTread2 {
	public static void main(String[] args){
		//T tt = new T();
		//tt.start();
		T tt = new T();
		Thread t = new Thread(tt);
		t.start();
		try{
			Thread.sleep(10000);
		}catch(InterruptedException e2){	
			System.out.println(e2.getMessage());
		}
		t.interrupt();
	}
}

//class T extends Thread{
class T implements Runnable{	
	public void run(){
		while(true){
			System.out.println("---"+new Date());
			try{
				Thread.sleep(1000);
			}catch(InterruptedException e){
				return;
			}
		}
	}
}
